<template>
	<view class="box">
		<view class="bk">
			<image class="img" :src="imgsrc" mode="scaleToFill"  fade-show=ture></image>
		</view>
		<view class="wz">
			<text style="font-size: 13px;">需要穿着全义圣工作服拍照</text>
		</view>
		<view><button class="btn" size="mini" @click="btn()">拍照</button></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//'http://5b0988e595225.cdn.sohucs.com/images/20190408/51e4eca9de8443ba90efb86f38b3a2cd.jpeg', 
				imgsrc:'file:///storage/emulated/0/Pictures/douyin/8df00dbafb2de39e03a48be28d7d9ed0.png', 
				// file:///storage/emulated/0/Pictures/douyin/8df00dbafb2de39e03a48be28d7d9ed0.png
			}
		},
		onLoad() {

		},
		methods: {
			//拍照
			btn() {
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					//sourceType: ['album'], //从相册选择
					success: function(res) {
						console.log("图片" + JSON.stringify(res.tempFilePaths));
						// 图片地址 res.tempFilePaths
						this.imgsrc = res.tempFilePaths;
						//图片成功上传时跳转
						uni.navigateTo({
							url: '../Dzwork/Dzphoto'
						})
					}
				});
			}

		}
	}
</script>

<style>
	.box {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.bk {
		width: 200px;
		height: 250px;
		border: solid 1px #aaaaa4;
		margin-top: 50px;
		//透明度 0.0完全透明
		opacity:0.8;
	}

	.wz {
		margin-top: 10px;
	}

	.btn {
		/* 	width: 100px;
		height: 30px;
		text-align: center; */
		margin-top: 20px;
		background-color: #007AFF;
		padding-top: 0px;
		padding-bottom: 0px;
	}

	.img {
		width: 200px;
		height: 250px;
		
	}
</style>
